package com.example.tests;

import com.example.fw.ContactObject;
import com.example.fw.Contacts;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import org.testng.annotations.Test;

public class ContactRemovalTests extends TestBase {

	@Test
	public void testFirstContactCanBeDeleted() throws Exception {
		Contacts oldList = app.getContactHelper().getContacts();
		ContactObject firstContact = app.getContactHelper().getFirstContact();
		app.getContactHelper().deleteContact();
		Contacts newList = app.getContactHelper().getContacts();
		assertThat(newList, equalTo(oldList.withRemoved(firstContact)));
	}
}
